/*
 * @version: 
 * @Author: yu
 * @Date: 2023-07-17 19:59:42
 * @LastEditors: Andy
 * @LastEditTime: 2023-07-17 20:00:02
 */
import axios from 'axios'

//拦截器
axios.interceptors.request.use(req => req)

//响应器
axios.interceptors.response.use(res => res.data)


export const get = (url, params) => {
    return new Promise((resolve, reject) => {
        axios.get(url, {
            params
        })
            .then(res => resolve(res))
            .catch(err => reject(err))
    })
}


export const post = (url, params) => {
    return new Promise((resolve, reject) => {
        axios.post(url, params)
            .then(res => resolve(res))
            .catch(err => reject(err))
    })
}


